package com.xnew.configuration;

import org.ehcache.event.CacheEvent;
import org.ehcache.event.CacheEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author yangcd
 * @Date 2020/10/14
 */
public class CacheConfiguration implements CacheEventListener<Object, Object>{

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public void onEvent(CacheEvent<?, ?> cacheEvent) {
        logger.info("cacheEvent:{},cache key:{},old value:{},new value:{} ",cacheEvent.getType(),cacheEvent.getKey(),cacheEvent.getOldValue(),cacheEvent.getNewValue());
    }

}
